package com.lyz.dataStructure.algorithm.腾讯面试2020;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 21:15
 * @Description:
 **/

import java.util.Scanner;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/9/1 21:15
 *@Description:
 **/
public class 宝藏 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n =sc.nextInt();
        int m =sc.nextInt();
        int[] num1 =new int[n];
        int oushu1 = 0;
        int jishu1 = 0;
        for(int i =0;i<n;i++){
            num1[i] = sc.nextInt();
            if(num1[i]%2 ==1){
                jishu1++;
            }else {
                oushu1++;
            }
        }
        int[] num2 = new int[m];
        int oushu2 =0;
        int jishu2 =0;
        for(int i =0;i<m;i++){
            num2[i] =sc.nextInt();
            if(num2[i]%2==1){
                jishu2++;
            }else {
                oushu2++;
            }
        }
        int res = Math.min(jishu1,oushu2)+Math.min(jishu2,oushu1);
        System.out.println(res);
        sc.close();
    }
}
